package com.example.stujava.module.xiangxue.annotation;

import androidx.annotation.IntDef;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

public class IntDefTest {

    public static void main(String[] args) {
        IntDefTest t = new IntDefTest();
        t.setType(3);
    }

    public static final int type_a = 1;
    public static final int type_w = 2;

    public void setType(@Tab int type) {
        System.out.println("type=" + type);
    }

    @IntDef(value = {type_a, type_w})
    @Target(ElementType.PARAMETER)
    @Retention(RetentionPolicy.SOURCE)
    public @interface Tab {

    }
}
